package com.cy.service;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import jdk.nashorn.internal.ir.RuntimeNode;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

@Component
public class DefaultRequestOriginParser implements RequestOriginParser {

    @Override
    public String parseOrigin(HttpServletRequest request) {
        //return request.getParameter("origin");
        String ip = request.getRemoteAddr();
        System.out.println("ip="+ip);
        return ip;
    }
}
